import { createRouter, createWebHistory } from 'vue-router'
//组件导入
// import Emp from '@/views/emp/index.vue';
import Layout from '@/views/layout/index.vue';
import IndexView from '@/views/index/index.vue';
import UserView from '@/views/user/index.vue';
import UserLoginView from '@/views/login/index.vue';
import categoryView from '@/views/category/index.vue';
import ServerView from '@/views/server/index.vue';
import LevelView from '@/views/level/index.vue';





const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
 routes: [
    // {path: '/emp',name: 'emp',component: Emp}
    {path: '/',
    name: 'layout',
    component: Layout,
    children:[
      {path:'/',redirect:'/index'},
      {path:'/index',name:'index',component:IndexView},
      {path:'/user',name:'user',component:UserView},
      {path:'/category',name:'category',component:categoryView},
      {path:'/server',name:'server',component:ServerView},
      {path:'/level',name:'level',component:LevelView}
      
    ]
    },
    {path:'/user/login',name:'userLogin',component:UserLoginView},
  ]
})

export default router
